﻿@model prufa.ViewModels.UserAndHighScore

@{
    ViewBag.Title = "UserId";
}



<fieldset>
    <legend>UserProfile</legend>
    <div class="display-field">
       <h2> @Html.DisplayFor(model => model.UserProfile.UserName)</h2>
    </div>
    <div class="display-field">
        Netfang: @Html.DisplayFor(model => model.UserProfile.Email)
    </div>
    <div class="display-field">
        Gerðist meðlimur: @Html.DisplayFor(model => model.UserProfile.Date)
    </div>
    <div class="avatar">
        <img class="avatar" src= "@Html.DisplayFor(model => model.UserProfile.Avatar)"/>
    </div>
    </fieldset>

<table id ="UserHighScore">
    <tr>  
        <th></th>
         <th>Fjöldi sigra</th>
       <th>Fjöldi spilaðra leikja</th>           
    </tr>
          
@foreach (var hs in Model.HighScore)
{
    <tr>
   @foreach(var gn in Model.GameName)
   {
       
      if(hs.GameId == gn.GameId)
      {
         <th>@Html.DisplayFor(model => gn.GameName)</th>
             <td> @Html.DisplayFor(model => hs.Win) </td>
            <td> @Html.DisplayFor(model => hs.GamesPlayed) </td>         
      }
   }
            
    </tr>               
}       
    <tr>       
        <th>Vinningsprósenta </th>
        
        <td>@Html.DisplayFor(model => model.WinRatio)%</td>
    </tr>
</table>

<p>
    @Html.ActionLink("Aftur í Notendalista", "UserList")
</p>

@*@if (User.IsInRole("Admin"))
{
    @Html.ActionLink("Aftur í Notendalista Umsjónarmanns", "AdminUserList", "User")
}*@
